package com.ruoyi.yljf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.yljf.domain.Notice;
import com.ruoyi.yljf.domain.dto.CreateDTO.NoticeCreateDTO;
import com.ruoyi.yljf.domain.dto.NoticeDTO;
import com.ruoyi.yljf.domain.vo.NoticeVO;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 笔记Mapper接口
 * 
 * @author metaee
 * @date 2025-01-04
 */
public interface NoticeMapper extends BaseMapper<Notice> {


    List<NoticeVO> selectNoticeListByConditions(NoticeCreateDTO notice);

    List<NoticeVO> selectNoticeListByConditionsV2(NoticeCreateDTO notice);

    @Update("UPDATE yljf_#{noticeType} SET likes = likes + 1 WHERE notice_Id = #{noticeId}")
    Integer like(Long noticeId,String noticeType);

    @Update("UPDATE yljf_#{noticeType} SET likes = likes - 1 WHERE notice_Id = #{noticeId}")
    Integer undoLike(Long noticeId,String noticeType);
}
